<ion-view view-title='' cache-view='false'>
  <!--   <ion-nav-buttons side="left">
  <a class="button button-icon button-clear ion-ios-arrow-back" href="#/tab/topics"></a>

</ion-nav-buttons> -->

  <ion-nav-buttons side="right">

    <button class="button button-icon icon ion-android-star-outline" ng-click="collect(topic)"></button>&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="button button-icon icon ion-share" ng-click="share(topic)"></button>
  </ion-nav-buttons>
  <ion-content class="has-header" >





    <div class="row topic" ng-if="finished">
      <div class="col col90">
        <h4 class="title">{{topic.title}}</h4>
        <div class="summary">
          <strong>
            <a href="#/user/{{topic.author.loginname}}">
              <img ng-src="{{topic.author.avatar_url | avatarFilter}}"  class="avatar" reset-img>
              <!-- <img ng-src="{{topic.author.avatar_url  | protocol}}" class="avatar" />  -->
              {{topic.author.loginname}}
            </a>
          </strong>
          <span class="item-note" am-time-ago="topic.last_reply_at"></span>
        </div>
        <div class="topic-content" ng-bind-html="topic.content | link">
        </div>
      </div>
    </div>
    <ion-list class="replies" ng-if="finished">
      <ion-item ng-if="topic.replies.length == 0">
        暂无评论
      </ion-item>
      <ion-item class="item-avatar" ng-repeat="reply in topic.replies" ng-click="showActions(reply)">
        <img ng-src="{{reply.author.avatar_url | avatarFilter}}"  reset-img>
        <p>
          <a href="#/user/{{reply.author.loginname}}" ng-class="{'bold': reply.author.loginname == topic.author.loginname}">
            {{reply.author.loginname}}
          </a>
          <span class="item-note" am-time-ago="reply.create_at">
          </span>
          <span class="item-note cnode" ng-if="reply.ups.length > 0">
            <i class="icon ion-thumbsup"></i> {{reply.ups.length}} &nbsp;
          </span>
        </p>
        <div class="reply-content" ng-bind-html="reply.content  | link"></div>
      </ion-item>
    </ion-list>
    <br />



    <ion-spinner class="topic-spinner ng-hide" ng-show="!finished" ng-style="{'top':getHalfHeight()+'px'}"></ion-spinner>



  </ion-content>
  <ion-footer-bar align-title="left" class="bar-light reply-new" keyboard-attach>
    <label class="item-input-wrapper">
      <input type="text" placeholder="回复" ng-model="replyData.content" ng-disabled="loginName == null">
    </label>
    <button class="button button-small button-clear button-positive" ng-click="saveReply()" ng-class="{'disabled':loginName == null || replyData.content == ''}">
      提交
    </button>
  </ion-footer-bar>
</ion-view>
